home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / System / NewIconsV4 / Developers / Include / libraries / newicon.h
C/C++ Source or Header  |  1999-03-11  |  5KB  |  146 lines

  1. #ifndef LIBRARIES_NEWICON_H
  2. #define LIBRARIES_NEWICON_H
  3.  
  4. #ifndef EXEC_LIBRARIES_H
  5. #include <exec/libraries.h>
  6. #endif
  7.  
  8. #ifndef WORKBENCH_WORKBENCH_H
  9. #include "workbench/workbench.h"
  10. #endif
  11.  
  12.  
  13. /* Programs should NOT change anything in the librarybase!
  14.  * Let the user do it through the preferences
  15.  */
  16.  
  17. struct NewIconBase
  18. {
  19.     struct Library nib_Lib;
  20.     APTR nib_SegList;
  21.     LONG nib_Precision; /* precision when remapping images via */
  22.                 /* RemapChunkyImage(). Programs are not supposed */
  23.                 /* to modify this, it is a value chosen by the user */
  24.                 /* in the preferences. */
  25.     LONG nib_Flags; /* library base flags - see NIFLG_#? defs below */
  26.     LONG nib_DPMode; /* Depth Promotion mode value. (V39) */
  27.     LONG nib_FOMode; /* Font Online mode (V40) */
  28.     LONG nib_Reserved;
  29. };
  30.  
  31.  
  32. /* This mask can be used to isolate the user preferences part of the flags */
  33. #define NIFLG_PUBMASK    0x0000FFFF
  34.  
  35.  
  36. /*** Library base flags ***/
  37.  
  38. #define NIFLG_DO_DITHER (1<<0)  /* use dithering when exact pen not available */
  39.  
  40. #define NIFLG_RESERVED  (1<<1)  /* Keep your hands away from that one
  41.                                    (V39) */
  42.  
  43. #define NIFLG_RTGMODE   (1<<2) /* Use FastRAM when possible instead of CHIP
  44.                                   Needs Cgfx or something similar that
  45.                                   properly patches graphics.library to
  46.                                   allow graphic/blitter work from FastRAM.
  47.                                   (V39) */
  48.  
  49. #define NIFLG_NOBORDER   (1<<3) /* Won't display any border around icons.
  50.                                    (V39) */
  51.  
  52. #define NIFLG_TRANSPARENT (1<<4) /*  Icons will become transparent.
  53.                                      Requires NoBorder to be enabled.
  54.                                      (V40) */
  55.  
  56. #define NIFLG_TRANSDRAG   (1<<5> /* Icons will become transparent & 
  57.                                     borderless while dragging.
  58.                                      (V40) */
  59.  
  60.  
  61. /*** System flags (0xFFFF0000) - These are READ-ONLY! ***/
  62.  
  63.  
  64. /* Set by the NewIcons exe if it's disabled through Exchange */
  65.  
  66. #define NIFLG_IS_DISABLED (1<<16) /* Commodity is disabled  
  67.                                         **READ-ONLY** (V40) */
  68.  
  69. /* These flags are set by the library depending on the features it can 
  70.    support. */
  71.  
  72. #define NIFLG_LIBRTG     (1<<17) /* This library supports RTG Mode
  73.                                        **READ-ONLY** (V40) */
  74.  
  75. #define NIFLG_LIBDIT     (1<<18) /* This library supports dithering
  76.                                        **READ-ONLY** (V40) */
  77.  
  78.  
  79.  
  80.  
  81. /* Values for nib_DPMode (V39) */
  82.  
  83. #define NIDPM_NEVER     0       /* Do not depth promote old icons */
  84. #define NIDPM_WBONLY    1       /* Only promote icons opened by Workbench */
  85. #define NIDPM_ALL       2       /* Depth promote all old icons opened */
  86.  
  87.  
  88. /* Values for nib_FOMode (V40) */
  89.  
  90. #define NIFOM_NONE      0       /* Normal */
  91. #define NIFOM_OUTLINE   1       /* Draw an outline border */
  92. #define NIFOM_SHADOW    2       /* Only cast a shadow */
  93.  
  94.  
  95. /*
  96.  * This structure contains an image in a format unusual to the Amiga: chunky
  97.  * pixel. We use this format because it is faster to remap to a given palette.
  98.  */
  99. struct ChunkyImage
  100. {
  101.     UWORD Width;        /* width of the image. Must be <= 93 */
  102.     UWORD Height;       /* height of the image. Must be <= 93 */
  103.     UWORD NumColors;    /* number of pens defined in the palette. Must be <= 256 */
  104.     UWORD Flags;        /* see defines below */
  105.     UBYTE *Palette;     /* array of RGB components of the pens (one byte per gun) */
  106.     UBYTE *ChunkyData;  /* Width*Height bytes storing the colors of the pixels */
  107. };
  108.  
  109. #define CIF_COLOR_0_TRANSP  (1<<0)  /* color 0 is transparent, not the one */
  110.                                     /* stored in palette */
  111.  
  112. #define CIF_DEFAULT         (1<<1)  /* when this bit is set, the image was */
  113.                                     /* obtained via the DEFAULTIMAGE ToolType, */
  114.                                     /* therefore it is not actually part of the */
  115.                                     /* icon and will not be stored in the */
  116.                                     /* ToolTypes on a PutNewDiskObject(). */
  117.  
  118.  
  119.  
  120. struct NewDiskObject
  121. {
  122.     struct DiskObject *ndo_StdObject;       /* The old-style icon */
  123.     struct ChunkyImage *ndo_NormalImage;    /* May be NULL, meaning no new style icon */
  124.     struct ChunkyImage *ndo_SelectedImage;  /* May be NULL, meaning no secondary image */
  125. };
  126.  
  127.  
  128.  
  129. /*** The prefs file format (V40)
  130.  
  131.      Prefs file must be named NewIcons.prefs and is located in the 
  132.      usual ENVARC: (and ENV:) path.
  133.  ***/
  134.  
  135. struct NewIconsPrefs
  136. {
  137.    UWORD version;       /* Prefs version, currently 0x0002 */
  138.    ULONG flags;         /* Flags (see NIFLG_#? definitions) */
  139.    LONG precision;      /* Precision setting (-1 = best, 16=worse) */
  140.    ULONG dpmode;        /* Depth Promotion mode (see NIDPM_#? definitions) */
  141.    ULONG fomode;        /* Font Outline mode (see NIFOM_#? definitions) */
  142. };
  143.  
  144.  
  145. #endif  /* LIBRARIES_NEWICON_H */
  146.